package com.ruoyi.leads.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.leads.mapper.LeadsMapper;
import com.ruoyi.leads.domain.Leads;
import com.ruoyi.leads.service.ILeadsService;

/**
 * 线索管理Service业务层处理
 * 
 * @author suoge
 * @date 2025-10-20
 */
@Service
public class LeadsServiceImpl extends ServiceImpl<LeadsMapper, Leads> implements ILeadsService
{
    @Autowired
    private LeadsMapper leadsMapper;

    /**
     * 查询线索管理
     * 
     * @param leadId 线索管理主键
     * @return 线索管理
     */
    @Override
    public Leads selectLeadsByLeadId(Long leadId)
    {
        return leadsMapper.selectLeadsByLeadId(leadId);
    }

    /**
     * 查询线索管理列表
     * 
     * @param leads 线索管理
     * @return 线索管理
     */
    @Override
    public List<Leads> selectLeadsList(Leads leads)
    {
        return leadsMapper.selectLeadsList(leads);
    }

    /**
     * 新增线索管理
     * 
     * @param leads 线索管理
     * @return 结果
     */
    @Override
    public int insertLeads(Leads leads)
    {
        leads.setCreateTime(DateUtils.getNowDate());
        return leadsMapper.insertLeads(leads);
    }

    /**
     * 修改线索管理
     * 
     * @param leads 线索管理
     * @return 结果
     */
    @Override
    public int updateLeads(Leads leads)
    {
        leads.setUpdateTime(DateUtils.getNowDate());
        return leadsMapper.updateLeads(leads);
    }

    /**
     * 批量删除线索管理
     * 
     * @param leadIds 需要删除的线索管理主键
     * @return 结果
     */
    @Override
    public int deleteLeadsByLeadIds(Long[] leadIds)
    {
        return leadsMapper.deleteLeadsByLeadIds(leadIds);
    }

    /**
     * 删除线索管理信息
     * 
     * @param leadId 线索管理主键
     * @return 结果
     */
    @Override
    public int deleteLeadsByLeadId(Long leadId)
    {
        return leadsMapper.deleteLeadsByLeadId(leadId);
    }
}
